package com.sq.partner.manager.dao;

import java.util.List;
import java.util.Map;

import com.sq.partner.manager.common.exception.AppException;
import com.sq.partner.manager.mybatis.model.GatewayUser;
import com.sq.partner.manager.mybatis.model.TradAgentInfo;
import com.sq.partner.manager.mybatis.model.TradSaleAgent;
import com.sq.partner.manager.util.Page;


/**
 * 
 * @author zzguo
 *
 */
public interface IGatewayAgentInfoMtDao extends BaseDao{
	
	public Page<TradAgentInfo> queryInfoByCriteria(Page<TradAgentInfo> page,GatewayUser user) throws Exception;
	
	public boolean addAgentInfo(TradAgentInfo agent) throws Exception;

	public boolean updateAgentInfo(TradAgentInfo agent) throws Exception;

	public boolean deleteAgentInfo(TradAgentInfo agent) throws Exception;

	public TradAgentInfo queryAgentInfoByCode(TradAgentInfo agent) throws Exception;
	
	public int checkIsExistConfigPlanInfo(Long agentId) throws Exception;
	
	public List<TradAgentInfo> searchExistUserCodeInfoFromDB(String str) throws AppException;
	
	public List<TradAgentInfo> searchExistSubBranchCodeInfoFromDB(Map<String, String> map) throws AppException;

	public List<TradAgentInfo> searchExistChannelInfoFromDB(String str) throws AppException;
	
	public void addBatchAgentInfo(List<TradAgentInfo> list) throws AppException;
	
	public Page<Map<String,Object>> queryAgentInfoWithUserPageByCriteria(Page<Map<String,Object>> page) throws Exception;
	
	public Page<Map<String,Object>> queryAgentInfoWithChannelPageByCriteria(Page<Map<String,Object>> page) throws Exception;
	
	public Page<Map<String,Object>> queryAgentInfoWithCombinedPageByCriteria(Page<Map<String,Object>> page) throws Exception;
	
	public Page<Map<String,Object>> queryAgentInfoWithCombinedPageByCriteria1(Page<Map<String,Object>> page) throws Exception;

	public List<TradAgentInfo> queryAgentInfoByMap(TradAgentInfo agent) throws Exception;
	
	public List<TradAgentInfo> searchExistUserCodeInfoFromDB(String channelCode,String str) throws AppException;

	/**费用跟单列表查询*/
	public List<TradSaleAgent> queryTrandSaleAgent(String id) throws Exception;
	
	/**删除*/
	public void deleteTrade(String id)throws Exception ;
	/**删除*/
	public void deleteTrade1(List<String> list)throws Exception ;
	
	/**导入广东销售个人代理信息系查询*/
	public  Map<String,String> queryTrade(String ids)throws Exception ;
	/**导入广东销售总对总代理信息查询*/
	public  Map<String,String> queryTrade1(String ids)throws Exception ;
	/**导入广东销售根据代理信息id查询*/
	public  Map<String,String> queryTrade2(String ids,String planType)throws Exception ;
	/**导入广东销售联合出单信息系查询*/
	public  Map<String,String> queryTrade3(String ids)throws Exception ;
	
	/**新增*/
	public boolean addTrade(List<TradSaleAgent> saleAgents) ;
	
	/**导入新增*/
	public boolean addTradeSale(List<TradSaleAgent> saleAgents,String agentType);
	
	/**联合出单查询key唯一*/
	public List<TradAgentInfo> queryAgentInByMap(Map<String, String> map) throws Exception;
	/**联合出单查询key唯一列表查询 */
	public List<TradAgentInfo> queryAgentInByMap1( String uniKey) ;
	
	/**批量更新*/
	public void updateBachAgentInfo(List<TradAgentInfo> agents) ;
	
	/**联合出单导入模板删除已配置的代理信息*/
	public boolean deleteCommPlanRate(Map<String, Object> map) throws Exception;
	/**联合出单导入模板删除已配置的代理信息界面配置*/
	public boolean deleteCommPlanRate1(Map<String, Object> map) throws Exception;
	/**联合出单导入模板添加*/
	public boolean addCommPlanRate(Map<String, Object> map) throws Exception;
	/***查询广东代理信息是否全部关联跟单费用信息
	 **/
	public List<TradAgentInfo> isExtTradPlanSale(Map<String, Object> map) throws Exception;
	
	/***查询广东代理信息是否全部关联跟单费用信息(总对总区域)*/
	public List<TradAgentInfo> isExtZonTradPlanSale4(Map<String, Object> map) throws Exception;
	/***查询广东代理信息是否全部关联跟单费用信息(联合出单区域)*/
	public List<TradAgentInfo> isExtZonTradPlanSale5(Map<String, Object> map) throws Exception;
	/**查询车险代理信息**/
	public Page<TradAgentInfo> selectCarAgentInfo(Page<TradAgentInfo> page)throws Exception;
	public int selectCarAgentInfoCount(Map<String, Object> map)throws Exception;
	public List<TradAgentInfo> selectAddCarAgentInfo (Map<String,String> map)throws Exception;

	TradAgentInfo queryAgentInfoByProductType(TradAgentInfo agentInfo)throws Exception;
}
